package com.springboot.astra.service.serviceImpl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.springboot.astra.bean.User;
import com.springboot.astra.mapper.UserMapper;
import com.springboot.astra.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public User getOneById(Integer id) {
        return userMapper.getOneById(id);
    }

    @Override
    public User getOneByAccount(String account) {
        return userMapper.getOneByAccount(account);
    }

    @Override
    public List<User> getAll() {
        return userMapper.getAll();
    }

    @Override
    public IPage<User> selectPageVo(Page<User> page, String query) {
        return userMapper.selectPageVo(page,query);
    }

    @Override
    public void insertUser(User user) {
        userMapper.insertUser(user);
    }

    @Override
    public void updateOneById(User user) {
        userMapper.updateOneById(user);
    }

    @Override
    public void deleteOneById(Integer id) {
        userMapper.deleteOneById(id);
    }

}
